package com.nx.samuel.stub_demo.consumer.stub;

import com.nx.samuel.stub_demo.api.HelloService;


public class WorldServiceStub implements HelloService {

    private HelloService helloService;

    public WorldServiceStub(HelloService helloService) {
        this.helloService = helloService;
    }

    @Override
    public String sayHello(String username) {
        try {
            System.out.println("在消费端执行，可以进行参数验证");
            String result = helloService.sayHello(username);
            return result;
        }catch (Exception e){
            e.printStackTrace();
            return "发生异常，伪装";
        }
    }
}
